package cn.itsource.util;

import org.apache.shiro.crypto.hash.SimpleHash;

public class Md5Util {

    //采用加密方式
    public static final String ALGORITHMNAME = "MD5";

    //加密次数
    public static final int HASHITERATIONS = 10;


    /**
     * 加密的工具类
     * @param source
     * @param salt
     * @return
     */
    public static String createMd5(String source,String salt){
        SimpleHash hash = new SimpleHash(ALGORITHMNAME, source, salt, HASHITERATIONS);
        return hash.toString();
    }
}
